package com.linktrip.devicemanager.server;

import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.linktrip.devicemanager.dao.IUpgradeDao;
import com.linktrip.devicemanager.entity.Upgrade;


@Service
@SuppressWarnings("rawtypes")
public class UpgradeService {

	Logger log = LoggerFactory.getLogger(UpgradeService.class);

	@Autowired
	IUpgradeDao upgradeDao;

	public boolean save(Upgrade record) {
		return upgradeDao.insertSelective(record) > 0;
	}

	public boolean delete(Integer id) {
		return upgradeDao.deleteByPrimaryKey(id) > 0;
	}

	public boolean update(Upgrade record) {
		return upgradeDao.updateByPrimaryKeySelective(record) > 0;
	}
	
	public Upgrade findById(Integer id) {
		return upgradeDao.selectByPrimaryKey(id);
	}

	public List<Upgrade> getList(Map map) {
		return upgradeDao.selectUpgradeList(map);
	}
	public List<Upgrade> getUpgradeList(Map map) {
		return upgradeDao.getUpgradeList(map);
	}

	public int count(Map map) {
		return upgradeDao.count(map);
	}
}
